package com.example.paperk.interceptor

import com.blankj.utilcode.util.SPStaticUtils
import okhttp3.Interceptor
import okhttp3.Request
import okhttp3.Response

class TokenInterceptor : Interceptor {
    override fun intercept(chain: Interceptor.Chain): Response? {
        var oldRequest : Request?=null
        oldRequest = chain.request()
        var build : Request.Builder
        build = Request.Builder()
        build.url(oldRequest.url())
        build.headers(oldRequest.headers())
        build.header("token",SPStaticUtils.getString("token"))
        var request : Request
        request = build.build()
        return chain.proceed(request)
    }
}